<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>凯哥的博客</title>
</head>
<body>
    <div>div</div>
    <a href="" id="href">href</a>

    <form action="" method="" id="form">
        <input type="text" name="user">
        <input type="radio" name="sex">
        <input type="submit">
    </form>

    <script>
        // let oForm = document.getElementById("form");

        // console.log(oForm.user);

        /*
        onfocus
        onblur
            并不是所有的元素都能添加焦点事件，只有能获得焦点的元素才能添加焦点事件
            document, a, window, 以及表单相关的元素
        */

        // let href = document.getElementById("href");
        // href.onfocus = function() {
        //     console.log("获取焦点了");
        // }
        // href.onblur = function() {
        //     console.log("失去焦点了");
        // }

        window.onfocus = function() {
            document.title = '凯哥的博客';
        };

        window.onblur = function() {
            document.title = "卧槽，搞起来了";
        }



    </script>
</body>
</html>